@extends('admin.layout')
@section('title','详情页')
@section('content')
    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                商品管理
                <small>在这里，你可以修改商品</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="{{ url('/admin/index')}}"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="{{ url('/admin/good/add')}}">商品管理</a></li>
                <li class="active">修改</li>
            </ol>
        </section>  

        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">快速修改商品</h3>
                        </div><!-- /.box-header -->
                        <!-- form start -->
                        <form role="form" action="{{url('/admin/order')}}/{{$data->oid}}" method="post" enctype="multipart/form-data">
                        {{ csrf_field() }}
                        {{method_field('PUT')}}
                            <div class="box-body">
                            @if (count($errors) > 0)
                                <div class="alert alert-danger">
                                    <ul>
                                        @foreach ($errors->all() as $error)
                                            <li>{{ $error }}</li>
                                        @endforeach
                                    </ul>
                                </div>
                            @endif
                                <div class="form-group">
                                    <label for="exampleInputEmail1">收货人</label>
                                    <input type="text" class="form-control" id="exampleInputEmail1" name="rec" value="{{$data->rec}}" 
                                           >
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputPassword1">联系电话</label>
                                    <input type="text" class="form-control" id="exampleInputPassword1" name="tel" value="{{$data->tel}}"
                                           >
                                </div>
                                 
                                <div class="form-group">
                                    <label for="exampleInputEmail1">收货地址</label>
                                    <input type="text" class="form-control" id="exampleInputEmail1" name="addr" value="{{$data->addr}}"
                                          >
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputFile">买家留言</label>
                                    <input type="text" class="form-control" id="exampleInputEmail1" name="umsg" value="{{$data->umsg}}"
                                          >
                                    
                                </div>
                                <!-- textarea -->
                               
                            </div><!-- /.box-body -->

                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">修改</button>
                            </div>
                        </form>
                        <table id="example2" class="table table-bordered table-hover">

                          
                                <thead>
                                <tr>
                                    <th>商品ID</th>
                                    <th>商品名</th>
                                    <th>商品图片</th>
                                    <th>类别</th>
                                    <th>定价</th>
                                    <th>购买数量</th>

                                </tr>
                                </thead>
                                <tbody>
                                @foreach($order as $row)
                                @foreach($row->oid as $ww)
                                <tr>
                                    <td>{{$ww->gid->gid}}</td>
                                    <td>{{$ww->gid->gname}}</td>
                                    <td><img src="{{asset($ww->gid->gpic)}}" width="50px" height="50px" ></td>
                                    <td>{{$ww->gid->tid}}</td>  
                                    <td>{{$ww->gid->price}}</td>
                                    <td>{{$ww->buycnt}}</td>
                                </tr>
                                @endforeach
                                @endforeach
                                <tr style="height: 50px;text-align: center;line-height: 50px; background: rgb(239,199,123);"><td>小计:</td><td rowspan="4">{{$row->ormb}}￥</td></tr>
                            </table>
                    </div><!-- /.box -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
@endsection